package com.gitee.francis.lw.form.service.impl;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gitee.francis.lw.form.service.IControlService;
import com.gitee.francis.lw.mapper.ControlAttrMapper;
import com.gitee.francis.lw.mapper.ControlMapper;
import com.gitee.francis.lw.mapper.model.db.ControlAttrDO;
import com.gitee.francis.lw.mapper.model.db.ControlDO;
import com.hzlemone.service.base.AbstractService;

/**
 * 
 * @ClassName ControlServiceImpl
 * @Description 表单组件模型。与数据表t_hz_lemon_e_control对应
 * @author 刘吴楚浩
 * @date Sun Jul 01 17:02:44 CST 2018
 * 
 */
@Service
@Transactional
public class ControlServiceImpl extends AbstractService<ControlDO, ControlDO>
		implements IControlService {
	@Resource
	private ControlMapper controlMapper;

	@Autowired
	ControlAttrMapper controlAttrMapper;

	@Override
	public void removeById(String[] ids) {
		for (String id : ids) {
			
			ControlAttrDO param = new ControlAttrDO();
			param.setControlId(id);
			controlAttrMapper.delete(param);
			
			mapper.deleteByPrimaryKey(id);
		}
	}
}